]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/network: Use wwan settings panel for GSM/LTE Modems
authorMohammed Sadiq <sadiq@sadiqpk.org>
Tue, 10 Aug 2021 09:52:30 +0000 (15:22 +0530)
committerMarge Bot <marge-bot@gnome.org>
Sat, 14 Aug 2021 10:39:56 +0000 (10:39 +0000)
GSM/UMTS/LTE modems now have better support with wwan panel in GNOME
Settings.  So, if the modem supports, open wwan panel, otherwise
fallback to opening network panel when "Mobile Broadband Settings"
item is clicked.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/583

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1942>

js/ui/status/network.js

index b1b11e114d0a86c7cd5aefce6f75b2f24933291c..a67af20656d84cd009851456a815bdd8579926b1 100644 (file)
@@ -543,7 +543,11 @@ var NMDeviceModem = class extends NMConnectionDevice {
     constructor(client, device) {
         super(client, device);
 
-        this.item.menu.addSettingsAction(_("Mobile Broadband Settings"), 'gnome-network-panel.desktop');
+        const settingsPanel = this._useWwanPanel()
+            ? 'gnome-wwan-panel.desktop'
+            : 'gnome-network-panel.desktop';
+
+        this.item.menu.addSettingsAction(_('Mobile Broadband Settings'), settingsPanel);
 
         this._mobileDevice = null;
 
@@ -573,8 +577,19 @@ var NMDeviceModem = class extends NMConnectionDevice {
         return NMConnectionCategory.WWAN;
     }
 
+    _useWwanPanel() {
+        // Currently, wwan panel doesn't support CDMA_EVDO modems
+        const supportedCaps =
+            NM.DeviceModemCapabilities.GSM_UMTS |
+            NM.DeviceModemCapabilities.LTE;
+        return this._device.current_capabilities & supportedCaps;
+    }
+
     _autoConnect() {
-        launchSettingsPanel('network', 'connect-3g', this._device.get_path());
+        if (this._useWwanPanel())
+            launchSettingsPanel('wwan', 'show-device', this._device.udi);
+        else
+            launchSettingsPanel('network', 'connect-3g', this._device.get_path());
     }
 
     _sessionUpdated() {